Added the errno to the messages printed with the ERR macro. Tidy the use of
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Wed, 30 Nov 2005 18:38:14 +0000 (18:38 +0000)
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Wed, 30 Nov 2005 18:38:14 +0000 (18:38 +0000)
this macro where newlines have been appended -- the macro does this itself so
there is no need to add another one.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/libxc/xc_linux_restore.c
tools/libxc/xc_linux_save.c
tools/libxc/xg_save_restore.h

index f25c185abcc4a4c1b7b206c42c603edb89fcef13..95ead1938987a1c56dd9ae00506059b57851b897 100644 (file)
@@ -221,7 +221,7 @@ int xc_linux_restore(int xc_handle, int io_fd,
     
     if(xc_domain_memory_increase_reservation(
            xc_handle, dom, max_pfn, 0, 0, NULL) != 0) { 
-        ERR("Failed to increase reservation by %lx KB\n", PFN_TO_KB(max_pfn));
+        ERR("Failed to increase reservation by %lx KB", PFN_TO_KB(max_pfn));
         errno = ENOMEM;
         goto out;
     }
@@ -487,7 +487,7 @@ int xc_linux_restore(int xc_handle, int io_fd,
                 for(k = 0; k < j; k++) {
                     if(!uncanonicalize_pagetable(L1TAB, 
                                                  region_base + k*PAGE_SIZE)) {
-                        ERR("failed uncanonicalize pt!\n"); 
+                        ERR("failed uncanonicalize pt!"); 
                         goto out; 
                     } 
                 }
index f91a30b4f3b9c78a2904e079481a36661d589953..2d15ee587dee0eb9f1d98d0a1cd22c0018d655c2 100644 (file)
@@ -523,13 +523,13 @@ static unsigned long *xc_map_m2p(int xc_handle,
 
     xmml.max_extents = m2p_chunks;
     if (!(xmml.extent_start = malloc(m2p_chunks * sizeof(unsigned long)))) { 
-        ERR("failed to allocate space for m2p mfns!\n"); 
+        ERR("failed to allocate space for m2p mfns"); 
         return NULL; 
     } 
 
     if (xc_memory_op(xc_handle, XENMEM_machphys_mfn_list, &xmml) ||
         (xmml.nr_extents != m2p_chunks)) {
-        ERR("xc_get_m2p_mfns:"); 
+        ERR("xc_get_m2p_mfns"); 
         return NULL;
     }
 
@@ -540,7 +540,7 @@ static unsigned long *xc_map_m2p(int xc_handle,
     } 
 
     if (!(entries = malloc(m2p_chunks * sizeof(privcmd_mmap_entry_t)))) { 
-        ERR("failed to allocate space for mmap entries!\n"); 
+        ERR("failed to allocate space for mmap entries"); 
         return NULL; 
     } 
 
@@ -794,7 +794,7 @@ int xc_linux_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters,
     pfn_batch = calloc(MAX_BATCH_SIZE, sizeof(unsigned long));
 
     if ((pfn_type == NULL) || (pfn_batch == NULL)) {
-        ERR("failed to alloc memory for pfn_type and/or pfn_batch arays."); 
+        ERR("failed to alloc memory for pfn_type and/or pfn_batch arrays"); 
         errno = ENOMEM;
         goto out;
     }
index b9a4d381222362fd9bbac7f16265cb52c87d577c..7c530b293cb7ccd13dd0656f18ba7ca02a4372f2 100644 (file)
@@ -10,7 +10,7 @@
 #define PROGRESS 0
 
 #define ERR(_f, _a...) do {                     \
-    fprintf(stderr, _f "\n" , ## _a);           \
+    fprintf(stderr, _f ": %d\n" , ## _a, errno);\
     fflush(stderr); }                           \
 while (0)